#include "Order.h"
#include <iostream>

Order::Order(void){
	drink = "";
	first = "";
	main = "";
	last = "";
}

Order::Order(const string& drink, const string& first, const string& main, const string& last)
:drink(drink), first(first), main(main), last(last){
	/*this->drink = drink;
	this->first = first;
	this->main = main;
	this->last = last;*/
}

Order::~Order(void){
	//fields deleted auto.
}

Order::Order(const Order& order){
	this->drink = order.drink;
	this->first = order.first;
	this->main = order.main;
	this->last = order.last;
}

string Order::toString() const{
	return "drink: " + getDrink() + "\t"
			  + "first: " + getFirst() + "\t"
			  + "main: " + getMain() + "\t"
			  + "last: " + getLast() + "\t";
}

// GETTERS

const string& Order::getDrink() const {
	return this->drink;
}

const string& Order::getFirst() const {
	return this->first;
}

const string& Order::getMain() const {
	return this->main;
}

const string& Order::getLast() const {
	return this->last;
}

// SETTERS

void Order::setDrink(const string& drink) {
	this->drink = drink;
}

void Order::clearDrink(){
	this->drink.clear();
}

void Order::setFirst(const string& first) {
	this->first = first;
}

void Order::clearFirst(){
	this->first.clear();
}

void Order::setMain(const string& main) {
	this->main = main;
}

void Order::clearMain(){
	this->main.clear();
}

void Order::setLast(const string& last) {
	this->last = last;
}

void Order::clearLast(){
	this->last.clear();
}
/*
int main(int argc, char** argv){

	// default ctor test
	Order o1;
	cout << "order1" 
		 << "\tdrink: " << o1.getDrink()
		 << "\tfirst: " << o1.getFirst()
		 << "\tmain: " << o1.getMain()
		 << "\tlast: " << o1.getLast() << endl;

	// non-default ctor test
	Order o2("soda", "salad", "pasta", "cake");
	cout << "order2" 
		 << "\tdrink: " << o2.getDrink()
		 << "\tfirst: " << o2.getFirst()
		 << "\tmain: " << o2.getMain()
		 << "\tlast: " << o2.getLast() << endl;

	// copy ctor test
	Order o3 = o2;
	cout << "order3" 
		 << "\tdrink: " << o3.getDrink()
		 << "\tfirst: " << o3.getFirst()
		 << "\tmain: " << o3.getMain()
		 << "\tlast: " << o3.getLast() << endl;

	// setters test
	o3.setDrink("coke");	o3.setFirst("anti pasti");	o3.setMain("rice");	o3.setLast("cookie");

	cout << "order2" 
		 << "\tdrink: " << o2.getDrink()
		 << "\tfirst: " << o2.getFirst()
		 << "\tmain: " << o2.getMain()
		 << "\tlast: " << o2.getLast() << endl;

	cout << "order3" 
		 << "\tdrink: " << o3.getDrink()
		 << "\tfirst: " << o3.getFirst()
		 << "\tmain: " << o3.getMain()
		 << "\tlast: " << o3.getLast() << endl;


	getchar();
	return 0;
}
*/